const path = require('path')
module.exports = {
  devServer: {
    port: 9527,
    open: true,
    proxy: { // 代理
      '/conner': {
        target: 'https://api.it120.cc',
        changeOrigin: true, // 代理到这个源
        pathRewrite: {
          '^/conner': '/conner'
        }
        /*
          /conner/a
         https://api.it120.cc/a
        */
      }
    }
  },
  lintOnSave: false,
  chainWebpack: (config) => {
    config.resolve.alias
      .set('@', path.join(__dirname, 'src'))
      .set('@views', path.join(__dirname, 'src/views'))
      .set('@components', path.join(__dirname, 'src/components'))
      .set('@utils', path.join(__dirname, 'src/utils'))
      .set('@api', path.join(__dirname, 'src/api'))
  }
}
